package com.pomr.model.equipmentstorage;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

import org.hibernate.annotations.GenericGenerator;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.pomr.model.simstorage.SimStorageDetail;
import com.pomr.model.sys.User;

/**
 * 
 * 类名称： DeviceMatch
 * 创建人： Administrator
 * 创建时间：2018年6月3日 上午11:06:08
 * 类描述：设备与SIM卡匹配类
 */
@Entity
@Table(name="equipment_sim_match")
public class DeviceMatch {
	public Date getBindTime() {
		return bindTime;
	}

	public void setBindTime(Date bindTime) {
		this.bindTime = bindTime;
	}

	public Date getNoBindTime() {
		return noBindTime;
	}

	public void setNoBindTime(Date noBindTime) {
		this.noBindTime = noBindTime;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public EquipmentStorageDetail getEquipmentdetail() {
		return equipmentdetail;
	}

	public void setEquipmentdetail(EquipmentStorageDetail equipmentdetail) {
		this.equipmentdetail = equipmentdetail;
	}

	public SimStorageDetail getSimdetail() {
		return simdetail;
	}

	public void setSimdetail(SimStorageDetail simdetail) {
		this.simdetail = simdetail;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO, generator = "native")
    @GenericGenerator(name = "native", strategy = "native")//AUTO 在mysql中需要指定使用本地策略生成主键值
	private Integer id;
	
	@ManyToOne(fetch=FetchType.EAGER)
	@JoinColumn(name="equipment_detail_id")
	private EquipmentStorageDetail equipmentdetail;//设备
	
	@ManyToOne(fetch=FetchType.EAGER)
	@JoinColumn(name="sim_detail_id")
	private SimStorageDetail simdetail;//sim卡
	
	
	@ManyToOne(fetch=FetchType.EAGER)
	@JoinColumn(name="user_id")
	private User user;//操作人
	
	@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
	@Column(name="bindTime")
	private Date bindTime;//绑定时间
	
	@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
	@Column(name="noBindTime")
	private Date noBindTime;//解绑时间
	

}
